package com.xique.park.bean.transform.web.refund;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import lombok.NoArgsConstructor;

/**
 * 退款状态excel导出转换
 *
 * @author WLD
 */
@NoArgsConstructor
public class RefundStatusConverter implements Converter<String> {

    @Override
    public Class<String> supportJavaTypeKey() {
        return String.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    @Override
    public CellData<String> convertToExcelData(String value, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) {
        switch (value) {
            case "00":
                return new CellData<>("受理失败");
            case "01":
                return new CellData<>("受理成功");
            case "02":
                return new CellData<>("退款中");
            case "03":
                return new CellData<>("退款成功");
            case "04":
                return new CellData<>("退款失败");
            default:
                return new CellData<>("未知");
        }
    }

    @Override
    public String convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) {
        return null;
    }

}
